package com.lang.dao.impl;

import com.lang.dao.ItemDao;
import com.lang.utils.C3P0Utils;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

/*
 * @Date : 2024/3/15 16:28
 * @Created by Lang
 * @ProjectName : LclShop
 */
public class ItemDaoImpl implements ItemDao {
    private QueryRunner runner = new QueryRunner(C3P0Utils.getDataSource());

    @Override
    public int deleteItemByOid(String id) {
        String sql = "delete from item where o_id = ?";
        try {
            return runner.update(sql, id);
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return 0;
    }
}
